import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12

/*
TextInput {
    id: cusTextField;

    height: 20;
    // width: 40;
    font.pixelSize: 15

    verticalAlignment: Text.AlignVCenter
    horizontalAlignment: Text.AlignHCenter
    selectByMouse: true

    color: "#ffffff";
    maximumLength: 64;
    selectionColor: "#ec4141";
    selectedTextColor: "#000000";

    // renderType: Text.NativeRendering

}
*/

TextField {
    id: cusTextField
    height: 24;
    hoverEnabled: enabled;
    selectByMouse: true;
    color: "#ffffff";
    maximumLength: 64;

    horizontalAlignment: Text.AlignHCenter;
    verticalAlignment: Text.AlignVCenter;

    selectionColor: "transparent";
    selectedTextColor: "#ec4141";

    font.pixelSize: 20;
    font.family: "Microsoft Yahei";
    font.bold: true;

    background: Rectangle {
        color: (cusTextField.enabled && !cusTextField.readOnly) ? "transparent" : "transparent";
        radius: 4;
        border.width: 1;
        // 边框颜色
        border.color: (cusTextField.enabled && !cusTextField.readOnly && (cusTextField.hovered || cusTextField.focus)) ? "#ec4141" : "#ec4141";
    }
}
